import scrapy
from scrapy.crawler import CrawlerProcess
from scrapy.utils.project import get_project_settings


class SplashSpider(scrapy.Spider):
    name = 'splash'
    """测试页面渲染，利用Srapy-Splash抓取JS动态渲染的网页数据"""

    def __init__(self, **kwargs):

        self.start_urls = ["https://product.suning.com/0070221027/853404550.html"]

        super().__init__(**kwargs)

    def parse(self, response):
        # print(response.text)
        pass


if __name__ == "__main__":
    crawl = CrawlerProcess(get_project_settings())
    crawl.crawl('splash')
    crawl.start()

